#ifndef __UTILS_H_INSIDE__
#error "<utils_win.h> is not allowed to include directly; use <utils.h> instead"
#endif

#ifndef _UTILS_WIN_H
#define _UTILS_WIN_H

/* Note: under windows, wide character is 2-byte */

#define G_DIR_SEPARATOR_WS G_PASTE(L, G_DIR_SEPARATOR_S)

/**
 * @name Wrapper functions to let \c GString support UTF-16 encoding
 *
 * You must use these series of functions to manipulate UTF-16 encoded \c
 * GSring.
 * @note Intended for Windows API
 */
/*@{*/
/**
 * @brief Create UTF-16 encoded \c GString
 * @param init  The text to copy into new \c GString (must be UTF-8 encoded)
 */
extern GString *g_string_new_utf16(const gchar *init);
extern GString *g_string_append_utf16(GString *utf16_str, const gunichar2 *val);
extern GString *g_string_truncate_utf16(GString *utf16_str, gsize len);

static inline void
path_append_component_utf16(GString *utf16_str, const gunichar2 *component)
{
    g_string_append_utf16(utf16_str, G_DIR_SEPARATOR_WS);
    g_string_append_utf16(utf16_str, component);
}
/*@}*/

#endif /* ! _UTILS_WIN_H */
